<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>添加申购信息</title>
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}" />
<script type="text/javascript" th:src="@{/js/jquery-2.2.3.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/laydate/laydate.js}"></script> 
 <script>
	lay('#version').html('-v'+ laydate.v);

	//执行一个laydate实例
	laydate.render({
		elem: '#signInStr' ,//指定元素
	});

</script>
<style type="text/css">
	#format{
		width: 400px;
		height: 300px;
		z-index: 1000;
		position: fixed;
		top: 50%;
		margin-top: -150px;
		left: 50%;
		margin-left: -300px;
		background: #fff;
		border: 1px solid rgba(39, 38, 38, 0.31);
		border-radius: 10px;
		padding: 15px;
		box-shadow: 2px 2px 5px #333333;
	}
</style>
</head>
<body>
<div id="format">
<span style="color:green;"><h1>添加申购信息</h1></span><br/>
<form th:action="@{/addGoods_purchase}" method="post">
 	指定审批人<select name="a_eid" id="a_eid" class="xiala">
				<option value="">请选择</option>
	 			</select>[[${a_eid}]]<br/>
	<!-- <input type="hidden" name="id" th:value="${session.user.id}"> -->
	<!-- 员工编号<input type="text" name="id"/>[[${id}]]<br/> -->
	申购物品<input type="text" name="gp_name"/>[[${gp_name}]]<br/>
	物品单价<input type="text" name="gp_dprice"/>[[${gp_dprice}]]<br/>
	申购数量<input type="text" name="gp_number"/>[[${gp_number}]]<br/>
	申购时间<input type="text" name="gp_time" id="signInStr"/>[[${gp_time}]]<br/>
	<!-- 申购状态<input type="text" name="gp_status"/>[[${gp_status}]]<br/> -->
	<input type="submit" class="btn btn-primary btn" value="添加" />
</form>
</div>

<!-- 展示审批人下拉框 -->
<script type="text/javascript">
function showApprovalPersons() {
	$.ajax({
		url : "/findApprovalPersons",
		success : function(data) {
			var obj = $("#a_eid");
			for (var i = 0; i < data.length; i++) {
				obj.append("<option value='"+data[i].id+"'>" + data[i].name
					+ "</option>");
			}
		},
		error : function(data) {
			alert(error);
		}
	});

}
$(function() {
	//展示审批人
	showApprovalPersons();
})
</script>
</body>
</html>